/**
 * Created with IntelliJ IDEA.
 * Description:文档注释
 * User:lenovo
 * Date:2024-05-03
 * Time:15:14
 */
public class Test {
    public static void main(String[] args) {
        /*int fourthBitFromRight=(n&0b1000)/0b1000;*/
        /*String expletive="Expletive";
        String PG13="deleted";
        String message=expletive+PG13;*/
        /*int age=13;
        String rating="PG"+age;
        //将rating设置为"PG13"*/
        /*int answer=1;
        System.out.println("The answer is "+answer);
        //The answer is 1*/
        /*String all=String.join("/","S","M","L","XL");
        //all is the string "S/M/L/XL"*/
        /*String repeated="Java".repeat(3);
        //repeated is "JavaJavaJava"*/
        String greeting="Hel";
        greeting=greeting.substring(0,3)+"p!";
    }
    public static void main4(String[] args) {
        double x=4;
        double y=Math.sqrt(x);
        System.out.println(y);//2.0
    }
        public static void main3(String[] args) {
            int a = 10;
            int b = 20;
            System.out.println("a == b = " + (a == b) );//false
            System.out.println("a != b = " + (a != b) );//true
            System.out.println("a > b = " + (a > b) );//false
            System.out.println("a < b = " + (a < b) );//true
            System.out.println("b >= a = " + (b >= a) );//true
            System.out.println("b <= a = " + (b <= a) );//false
            System.out.println(" a++ = "+(a++));//10    1.使用a 2.a=a+1
            System.out.println(" ++a = "+(++a));//12    1.a=a+1 2.使用a
        }
    /*public class Constants2{
        public static final double CM_PER_INCH=2.54;
        public static void main(String[] args) {
            double width=8.5;
            double height=11;
            System.out.println("Paper size in centimeters:"+width*CM_PER_INCH+"by"+height*CM_PER_INCH);
        }
    }*/
    public static void main2(String[] args) {
        final double CM_PER_INCH=2.54;
        double width=8.5;
        double height=11;
        System.out.println("Paper size in centimeters:"+width*CM_PER_INCH+"by"+height*CM_PER_INCH);
    }
    /*public static void main1(String[] args) {
        //法二.声明的同时初始化
        int vacationDays=12;
        //法一：先声明后初始化
        int vacationDays;
        vacationDays=12;
        *//*var vacationDays=12;//vacationDays is an int
        var greeting="Hello!";//greeting is a String*//*
    }*/
}
